<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <button class="btn"></button>



    <script>
        let btn = document.querySelector(".btn")
        // setTimeout(() => {
        //     let e = document.createEvent("MouseEvents");
        //     e.initEvent("click", true, true);
        //     btn.dispatchEvent(e)

        // }, 1000);

        // let s = () => {
        let cc = setInterval(() => {
            let e = document.createEvent("MouseEvents")
            e.initEvent("click", true, true)
            btn.dispatchEvent(e)
        }, 1000)
        // }
        btn.onclick = () => {
            console.log("asd")
        }
    </script>
</body>


</html>